package com.sjb.thread;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 有点儿意思
 * @Description:
 */
public class CreateThreadDemo {
    public static void main(String[] args) {
        Object lock = new Object();
        Thread thread = new Thread(() -> {
            System.out.println("线程开始执行....");
            synchronized (lock){
            }
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("线程执行完毕....");
        });
        //启动线程
        thread.start();
        System.out.println("主线程继续执行....");
    }
}
